<!doctype html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <!--  快捷logo -->
    <link rel="icon" type="image/png" href="/static/images/favicon.ico">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <title>班级管理</title>

    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
    <meta name="viewport" content="width=device-width" />


    <!-- Bootstrap css样式   -->
    <link href="/assets/css/bootstrap.min.css" rel="stylesheet" />


    <!-- Animation library for notifications   -->
    <link href="/assets/css/animate.min.css" rel="stylesheet"/>

    <!--  Light Bootstrap Table core CSS    -->
    <link href="/assets/css/light-bootstrap-dashboard.css?v=1.4.0" rel="stylesheet"/>
    <script th:src="@{/static/js/jquery-1.8.3.min.js}"></script>
    <!--     Fonts and icons     -->
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
    <link href='http://fonts.googleapis.com/css?family=Roboto:400,700,300' rel='stylesheet' type='text/css'>
    <link href="/assets/css/pe-icon-7-stroke.css" rel="stylesheet" />
    <script>
        $(function () {
            $(".del_class").bind("click", function () {
                let classname = $(this).parent().parent().parent().prev().prev().prev().html();
                let flag = confirm("确定删除" + '"' +classname+ '"' + "这个班级信息吗？");
                return flag;
            });
        });
    </script>
</head>
<body>

<div class="wrapper">
    <div class="sidebar" data-color="purple" data-image="/assets/img/sidebar-5.jpg">

        <div class="sidebar-wrapper">
            <div class="logo">
                <a href="#" class="simple-text">
                    学校管理系统
                </a>
            </div>

            <ul class="nav">
                <li class="active">
                    <a th:href="@{/user/index.do}">
                        <i class="pe-7s-home"></i>
                        <p>首页</p>
                    </a>
                </li>

                <li class="active" >
                    <a th:href="@{/collage/tocollage.do}">
                        <i class="pe-7s-display2"></i>
                        <p>学院管理</p>
                    </a>
                </li>

                <li class="active">
                    <a th:href="@{/teacher/toteacher.do}" >
                        <i class="pe-7s-study"></i>
                        <p>
                            辅导员管理
                        </p>
                    </a>
                </li>

                <li class="active">
                    <a th:href="@{/class/toclass.do}" >
                        <i class="pe-7s-users"></i>
                        <p>
                            班级管理
                        </p>
                    </a>
                </li>


                <li class="active">
                    <a th:href="@{/dorm/todorm.do}" >
                        <i class="pe-7s-umbrella"></i>
                        <p>
                            宿舍管理
                        </p>
                    </a>
                </li>

                <li class="active">
                    <a th:href="@{/student/tostudent.do}" >
                        <i class="pe-7s-id"></i>
                        <p>
                            学生管理
                        </p>
                    </a>
                </li>


            </ul>
        </div>
    </div>

    <div class="main-panel">
        <nav class="navbar navbar-default navbar-fixed">
            <div class="container-fluid">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                </div>
                <div class="collapse navbar-collapse">

                    <ul class="nav navbar-nav navbar-right">
                        <li>
                            <a href="#">
                                欢迎<span style="color:chocolate;" th:text="${session.user.getUsername()}"></span>
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/user/logout.do}">
                                退出
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>


        <div class="content">
            <div class="container-fluid">
                <div class="row" >
                    <div class="col-md-12">
                        <div class="card">
                            <div class="header" style="height: 100px">
                                <div class="col-sm-12 search-collapse">
                                    <form method="post" action="/class/toclass.do">
                                        <div class="select-list">
                                            <ul class="nav navbar-nav navbar-left">
                                                <li>
                                                    <label>班级名称：</label>
                                                    <input class="input-group-sm" style="width: 180px;height: 30px;" type="text" name="className"/>
                                                </li>
                                                <li style="margin-left: 20px">
                                                    <button class="btn btn-block" style="width: 80px;height: 30px;background: #31b0d5" type="submit">
                                                        <p style="font-size: 16px;color: black;margin-left: -5px;margin-top: -8px">
                                                            <i class="fa fa-search"></i>搜索
                                                        </p>
                                                    </button>
                                                </li>
                                                <li style="margin-left: 20px">
                                                    <button class="btn btn-block" style="width: 80px;height: 30px;background: #31b0d5" type="reset">
                                                        <p style="font-size: 16px;color: black;margin-left: -5px;margin-top: -8px">
                                                            <i class="fa fa-refresh"></i>重置
                                                        </p>
                                                    </button>
                                                </li>
                                            </ul>
                                        </div>
                                    </form>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>

            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">

                            <div class="header" style="margin-bottom: 30px">
                                <ul class="nav navbar-nav navbar-left">
                                    <li style="margin-left: 20px">
                                        <button class="btn btn-block" style="width: 80px;height: 35px;background: #31b0d5" onclick="location.href='/class/toadd.do'" >
                                            <p style="font-size: 16px;color: black;margin-left: -5px;margin-top: -8px">
                                                <i class="fa fa-plus"></i>新增
                                            </p>
                                        </button>
                                    </li>
                                </ul>
                            </div>

                            <div class="content table-responsive table-full-width">
                                <table class="table table-hover table-striped">
                                    <thead>
                                    <th>序号</th>
                                    <th>班级ID</th>
                                    <th>班级名称</th>
                                    <th>班级人数</th>
                                    <th>班级备注</th>
                                    <th>操作</th>
                                    </thead>
                                    <tbody>
                                    <tr th:each="c : ${pagelist.list}">
                                        <td th:text="${cStat.count}"></td>
                                        <td th:text="${c.getClassId()}"></td>
                                        <td th:text="${c.getClassName()}"></td>
                                        <td th:text="${c.getClassNum()}"></td>
                                        <td th:text="${c.getClassBz()}"></td>
                                        <td>
                                            <ul class="nav navbar-nav navbar-left">
                                                <li>
                                                    <a class="btn btn-block" style="width: 80px;height: 20px;background: #31b0d5;"  th:href="@{/class/promodify.do(Id=${c.classId})}">
                                                        <p style="font-size: 16px;color: black;margin-left: -5px;margin-top: -13px">
                                                            <i class="fa fa-edit"></i>修改
                                                        </p>
                                                    </a>
                                                </li>
                                                <li style="margin-left: 5px">
                                                    <a class="btn btn-block del_class"  style="width: 80px;height: 20px;background: #31b0d5"  th:href="@{/class/delete.do(Id=${c.classId})}" >
                                                        <p style="font-size: 16px;color: black;margin-left: -5px;margin-top: -13px">
                                                            <i class="fa fa-remove"></i>删除
                                                        </p>
                                                    </a>
                                                </li>
                                            </ul>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>

                                <div class="row">
                                    <ul class="nav navbar-nav navbar-left" style="margin-left: 40%;font-size: 20px">
                                        <li th:if="${pagelist.hasPreviousPage}"><a th:href="@{/class/toclass.do(pageNum=${pagelist.getPageNum()-1},className=${className})}">&laquo;</a></li>
                                        <li th:if="${!pagelist.hasPreviousPage}"><a href="#">&laquo;</a></li>

                                        <li th:if="${pagelist.pages>0}" th:each="k : ${#numbers.sequence(1,pagelist.pages)}" th:class="${pagelist.getPageNum() == k ? 'active' : ''}">
                                            <a th:href="@{/class/toclass.do(pageNum=${k},className=${className})}" th:text="${k}"></a>
                                        </li>

                                        <li th:if="${pagelist.hasNextPage}"><a th:href="@{/class/toclass.do(pageNum=${pagelist.pageNum+1},className=${className})}">&raquo;</a></li>
                                        <li th:if="${!pagelist.hasNextPage}"><a href="#">&raquo;</a></li>

                                    </ul>
                                </div>


                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <footer class="footer">
            <div class="container-fluid">
                <p class="copyright pull-right">
                    Copyright © 2024 王利强、高瑞峰、周昱龙、梁瑞天、田德军.</a>
                </p>
            </div>
        </footer>

    </div>
</div>


</body>


<!--   Core JS Files   -->
<script src="/assets/js/jquery.3.2.1.min.js" type="text/javascript"></script>
<script src="/assets/js/bootstrap.min.js" type="text/javascript"></script>

<!--  Charts Plugin -->
<script src="/assets/js/chartist.min.js"></script>

<!--  Notifications Plugin    -->
<script src="/assets/js/bootstrap-notify.js"></script>

<!-- Light Bootstrap Table Core javascript and methods for Demo purpose -->
<script src="/assets/js/light-bootstrap-dashboard.js?v=1.4.0"></script>

<!-- Light Bootstrap Table DEMO methods, don't include it in your project! -->
<script src="/assets/js/demo.js"></script>



</html>
